# -*- coding: utf-8 -*-

from odoo import models, fields, api
import logging

_logger = logging.getLogger(__name__)


class wliotTest(models.Model):
    _name = 'wliot.test'

    name = fields.Char(u'测试')

    @api.multi
    def control_back(self):
        _logger.info('=========test=========')
        device_command_logs = self.env['wliot.device.command.log'].sudo().search([])
        for device_command_log in device_command_logs:
            if device_command_log.status == 'send':
                device_command_log.write({
                    'status': 'work'
                })
